/**
This file is part of dbdjasperreport.

Copyright (C) 2008 Kue Vang aka Kou
Licensed under the Eclipse Public License, Version 1.0; 
you may not use this file except in compliance with the License. 
You may obtain a copy of the License at http://www.eclipse.org/legal/epl-v10.html 
Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an "AS IS" BASIS, 
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
See the License for the specific language governing permissions and limitations 
under the License.
**/

class Report implements Comparable{
	
	static constraints = {
		id()
		reportSystem()
		reportName(maxSize:100,blank:false,nullable:false)
		reportTitle(maxSize:200,blank:false,nullable:false)
		showReport(maxSize:1,inList:["Y","N"])
		orderByClauseOverride(blank:true,nullable:true)
		designer(blank:true,nullable:true)
		userResponsible(blank:true,nullable:true)
		comments(blank:true,nullable:true,maxSize:400)
		reportEnded(maxSize:1,inList:["N","Y"])
		dateCreated()		
		reportParameters()
	}
	
	//SortedSet reportParameters
	static belongsTo = [reportSystem:ReportSystem]
	static hasMany = [reportParameters:ReportParameter]
	
	Integer id
	String 	reportName
	String 	reportTitle
	String 	showReport
	String	orderByClauseOverride
	String	designer
	String	userResponsible
	String 	comments
	String	reportEnded
	Date	dateCreated
	
	String toString(){
		reportTitle
	}
	
	int compareTo(obj){
		reportTitle.compareTo(obj.reportTitle)
	}

}
